:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4bb543;
    --danger-color: #ff3333;
    --warning-color: #f8d210;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
    opacity: 0.1;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


.floating-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    z-index: 100;
}

.floating-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px) scale(1.1);
}


.game-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    color: black;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.word-display {
    font-size: 4.5rem;
    font-weight: 700;
   
}

.input-container {
    position: relative;
    margin: 30px 0;
}

.input-container .input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 1.2rem;
}

#text {
    width: 100%;
    padding: 20px 20px 20px 50px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    transition: var(--transition);
}

#text:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.stat-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    width: 45%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-box.timer {
    background: linear-gradient(135deg, #fff8f8 0%, #ffebeb 100%);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label i {
    margin-right: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}


.settings-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.settings-container.show {
    opacity: 1;
    visibility: visible;
}

.settings-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--box-shadow);
    transform: translateY(-20px);
    transition: var(--transition);
}

.settings-container.show .settings-card {
    transform: translateY(0);
}

.settings-card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.settings-card h2 i {
    margin-right: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.styled-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1em;
}

.styled-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.close-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn i {
    margin-right: 8px;
}

.close-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* 游戏结束界面 */
.end-game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.end-game-container.show {
    opacity: 1;
    visibility: visible;
}

.end-game-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--box-shadow);
    transform: scale(0.9);
    transition: var(--transition);
}

.end-game-container.show .end-game-card {
    transform: scale(1);
}

.result-icon {
    font-size: 4rem;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.end-game-card h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.final-score span {
    color: var(--primary-color);
    font-weight: 700;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.play-again-btn, .share-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-again-btn {
    background: var(--primary-color);
    color: white;
}

.play-again-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.share-btn {
    background: #f0f0f0;
    color: var(--dark-color);
}

.share-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}




@media (max-width: 768px) {
    .game-container {
        margin: 20px auto;
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .word-display {
        font-size: 2.5rem; 
        font-weight: 600; 
      
    }
    
    .stats-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-box {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}